<script type="text/javascript" lang="javascript">
var jcnt_chk = '<?php __is_loggedin(); ?>';  
function login_err_msg(){
  var newmsg = err_msg+"Plese login to view this section.";
  newmsg += '<br\/> <a title="Login" href="<?php __e(site_url('login'));?>">Login</a>&nbsp;&nbsp;'
  newmsg += 'or&nbsp;&nbsp;<a title="Register" href="<?php __e(site_url('members'));?>">Register</a>';
  jQuery.facebox(newmsg); 
}
function fn_stats_j_read(){
  ajx_container 	= 'admin_msg';
	ajx_url 		= site_url+'/journals/ajax/stats/jour';	
	ajx_formdata 	= '';
  ajx_formdata += "jid=<?php __e($journals_data['os_journals_id']);?>";
  run_ajax();
}

function fn_stats_pub_vis(){
  ajx_container 	= 'admin_msg';
	ajx_url 		= site_url+'/journals/ajax/stats/pubvis';	
	ajx_formdata 	= '';
  ajx_formdata += "pid=<?php __e($str_pub_id);?>";
  run_ajax();
}

function fn_stats_a_read(aid){
  ajx_container 	= 'admin_msg';
	ajx_url 		= site_url+'/journals/ajax/stats/art';	
	ajx_formdata 	= '';
  ajx_formdata += "jid=<?php __e($journals_data['os_journals_id']);?>";
  ajx_formdata += "&aid="+aid;
  run_ajax();
  
  ajx_container 	= 'admin_msg';
	ajx_url 		= site_url+'/journals/ajax/stats/pubrd';	
	ajx_formdata 	= '';
  ajx_formdata += "pid=<?php __e($str_pub_id);?>";
  run_ajax();
}

function fn_opn_art(os_url){
  
  var wid = $(window).width();
  var hei = $(window).height();
  os_pop_up(os_url,wid,hei);
  
}

jQuery(document).ready(function () {
  /*get stats for most read journal*/
  fn_stats_j_read();
  fn_stats_pub_vis();
});
</script>

<h2><?php echo $cont_title; ?></h2>
<form name="frm_dwl" id="frm_dwl" action="" method="post">
  <input type="hidden" name="hd_file" id="hd_file" value="" />
  <input type="hidden" name="hd_info" id="hd_info" value="" />
</form>

<?php if(isset($cat_info['id'])){ ?>
<div class="srch_cnt">
  <strong>Category:</strong> <a href="<?php __e(site_url('journals/subjects/'.$cat_info['id']));?>"><?php __e($cat_info['name']);?></a>
</div>
<?php } ?>
<form action="<?php __e($frm_action);?>" method="post" name="<?php __e($frm_name);?>" id="<?php __e($frm_name);?>" class="frmreg jour_contents" enctype="multipart/form-data">
  <table width="100%" class="tables_sample1 mytables" id="myTable" cellpadding="0" cellspacing="0">
    <tr>
      <td align="left" valign="top" width="10%">
        <?php __e( _journals_img($journals_data['os_journals_cover_img'],$journals_data['os_journals_title'],0,$journals_data['os_journals_id'] ) );?>
      </td>
      <td>
        <table width="100%" class="tables_sample1"cellpadding="0" cellspacing="0" style="margin-left: 10px;">
          <tr>
            <td align="left" valign="top" width="10%"><h3><?php __display_data($journals_data['os_journals_title']);?></h3></td>
          </tr>
          <?php if(!empty($journals_data['os_journals_copyright'])){ ?>
          <tr>
            <td align="left" valign="top" width="10%">Copyright: <?php __display_data($journals_data['os_journals_copyright']);?></td>
          </tr>
          <?php } ?>
          <tr>
            <td align="left" valign="top" width="10%">ISSN: <strong><?php __display_data($journals_data['os_journals_issn']);?></strong></td>
          </tr>
          <?php if(!empty($journals_data['os_journals_e_issn'])){ ?>
          <tr>
            <td align="left" valign="top" width="10%">E-ISSN: <strong><?php __display_data($journals_data['os_journals_e_issn']);?></strong></td>
          </tr>          
          <?php } ?>
          <tr>
            <td align="left" valign="top" width="10%">Publisher: <strong><?php __display_data($str_pub_name);?></strong></td>
          </tr>
          <tr>
            <td width="2%" align="left" valign="top">
              Access: <strong><?php $chk = ($journals_data['os_journals_access']==1)?'Paid':'Open';__display_data($chk);?></strong>, 
              Subscription: <strong><?php __display_data($journals_data['os_journals_subscription']);?></strong>
            </td>
          </tr>
          <tr>
            <td width="2%" align="left" valign="top">Issues Per Year: <strong><?php __display_data($journals_data['os_journals_issue']);?></strong>,
              Price: <strong><?php __display_data(__price($journals_data['os_journals_price']));?> | <?php __display_data(__price($journals_data['os_journals_price'], 'USD'));?></strong>
            </td>
          </tr>
          
          <tr>
            <td align="left" valign="top" width="10%">              
              <a href="javascript:;" onclick="javascript:add_fav_jur('<?php __display_data($journals_data['os_journals_id']);?>');" title="<?php __display_data($journals_data['os_journals_title']);?>" class="conta jur_<?php __display_data($journals_data['os_journals_id']);?>">
                <img src="<?php __e(base_url() . 'images/icons/page_add.png' );?>" width="16" height="16" />
              </a>
              <a href="javascript:;" onclick="javascript:add_fav_jur('<?php __display_data($journals_data['os_journals_id']);?>');" title="<?php __display_data($journals_data['os_journals_title']);?>" class="conta jur_<?php __display_data($journals_data['os_journals_id']);?>"">Add to Favourites</a>
              <span class="conta">|</span>
              <a href="javascript:;" onclick="javascript:alert_fav_jur('<?php __display_data($journals_data['os_journals_id']);?>');" title="<?php __display_data($journals_data['os_journals_title']);?>" class="conta art_<?php __display_data($journals_data['os_journals_id']);?>">
                <img src="<?php __e(base_url() . 'images/ds/25/20.png' );?>" width="16" height="16" />
              </a>
              <a href="javascript:;" onclick="javascript:alert_fav_jur('<?php __display_data($journals_data['os_journals_id']);?>');" title="<?php __display_data($journals_data['os_journals_title']);?>" class="conta art_<?php __display_data($journals_data['os_journals_id']);?>"">Alert me about new Volumes / Issues</a>              
            </td>
          </tr>
          
        </table>
      </td>
    </tr>
  </table>
  
  
  
  <div class="curhd"><strong>Current: </strong> Volume <i><?php __e($cur_vol_no);?></i>, 
    <strong>Issue</strong> <i><?php __e($cur_issue_no);?></i>, <br/>
    <strong>Pages</strong> <i><?php __e($cur_vol_pages);?></i>
  </div>
   
  <?php if(!empty ($journals_data['os_journals_abstract'])){ ?>
  <div>
    <strong class="j_abs">Journal Abstract:</strong> 
    <a href="javascript:;" class="conta" onclick="javascript:slideme('jouabs1','cl','fast');">
      <img src="<?php __e(base_url() . 'images/icons/magnifier.png' );?>" title="Show preview" width="16" height="16"/>
    </a>
    <a href="javascript:;" class="" onclick="javascript:slideme('jouabs1','cl','fast');" title="Show preview">Preview</a>    
    <br/>
    <div class="show_cont2 jouabs1" style="display: none;"><?php __display_data($journals_data['os_journals_abstract']);?></div>
  </div>
  <?php } ?>
  
  <?php /*if(!empty ($journals_data['os_journals_toc'])){ ?>
  <div>
    <strong class="j_abs">Journal Table Of Contents:</strong>
    <a href="javascript:;" class="conta" onclick="javascript:slideme('joutoc1','cl','fast');">
      <img src="<?php __e(base_url() . 'images/icons/magnifier.png' );?>" title="Show preview" width="16" height="16"/>
    </a>
    <a href="javascript:;" class="" onclick="javascript:slideme('joutoc1','cl','fast');" title="Show preview">Preview</a>
    <br/>
    <div class="show_cont2 joutoc1" style="display: none;"><?php __display_data($journals_data['os_journals_toc']);?></div>
  </div>
  <?php }*/ ?>
  
  <?php if(!empty ($journals_data['os_journals_descp'])){ ?>
  <div>
    <strong class="j_abs">Journal Description:</strong>
    <a href="javascript:;" class="conta" onclick="javascript:slideme('joudecp1','cl','fast');">
      <img src="<?php __e(base_url() . 'images/icons/magnifier.png' );?>" title="Show preview" width="16" height="16"/>
    </a>
    <a href="javascript:;" class="" onclick="javascript:slideme('joudecp1','cl','fast');" title="Show preview">Preview</a>
    <br/>
    <div class="show_cont2 joudecp1" style="display: none;"><?php __display_data($journals_data['os_journals_descp']);?></div>
  </div>
  <?php } ?>
  <br/>
  
  
  <?php if(__j_access($journals_data['os_journals_id'], $journals_data['os_journals_access'])){ ?>
  
  <table width="100%" class="tables_sample1 mytables" id="myTable" cellpadding="0" cellspacing="0">
    <thead>
      <tr>
        <th align="left" width="5%" class="tablehedingbg1">&nbsp;</th>
        <th align="left" class="tablehedingbgm" colspan="4">
          <a href="#" class="conta">
            <img src="<?php __e(base_url() . 'images/icons/png/download.png' );?>" width="16" height="16" />
          </a>
          <a href="#" class="conta">
            Purchase
          </a> 
          <span class="conta">|</span>
          <a href="#" class="conta">
            <img src="<?php __e(base_url() . 'images/icons/folder_table.png' );?>" width="16" height="16" />
          </a>          
          <a href="#" class="conta">
            Open All
          </a>          
        </th>        
        <th align="left" width="1%" class="tablehedingbg2">&nbsp;</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>&nbsp;</td>
        <td width="2%" align="left" valign="top">1</td>
        <td width="5%" align="left" valign="top"><input type="checkbox" class="chk" name="chk_id" /></td>
        <td width="5%" align="left" valign="top"><img src="<?php __e(base_url() . 'images/icons/folder_table.png' );?>" width="16" height="16" /></td>
        <td align="left" valign="top"><table width="100%" cellpadding="0" cellspacing="0" class="info_data">
            <tr>
              <td width="2%" align="left" valign="top"><h4>Editorial Board</h4></td>
            </tr>
            <tr>
              <td width="6%" align="left" valign="top">Editors In Chief: <i><?php __display_data($journals_data['os_journals_editors_in_chief']);?></i></td>
            </tr>
            <tr>  
              <td align="left" valign="top">
                <a href="javascript:;" class="conta">
                  <img src="<?php __e(base_url() . 'images/icons/magnifier.png' );?>" title="Show preview" width="16" height="16" onclick="javascript:slideme('cont1','cl','fast');"/>
                </a>
                <a href="javascript:;" class="conta" onclick="javascript:slideme('cont1','cl','fast');" title="Show preview">Show preview</a>                
              </td>
            </tr>
            <tr>  
              <td align="left" valign="top">
                <div class="show_cont cont1" style="display: none;">   
                  <strong class="strg">Editors</strong>
                  <p><?php __display_data($journals_data['os_journals_editorial']);?></p>
                  <br/>
                  <strong class="strg">Co-Editors</strong>
                  <p><?php __display_data($journals_data['os_journals_co_editors']);?></p>
                </div>
              </td>
            </tr>
          </table></td>
        <td>&nbsp;</td>  
      </tr>
      
      <tr>
        <td>&nbsp;</td>
        <td width="2%" align="left" valign="top">2</td>
        <td width="5%" align="left" valign="top"><input type="checkbox" class="chk" name="chk_id" /></td>
        <td width="5%" align="left" valign="top"><img src="<?php __e(base_url() . 'images/icons/folder_table.png' );?>" width="16" height="16" /></td>
        <td align="left" valign="top"><table width="100%" cellpadding="0" cellspacing="0" class="info_data">
            <tr>
              <td width="2%" align="left" valign="top"><h4>Abstract</h4></td>
            </tr>
            <tr>  
              <td align="left" valign="top">
                <a href="javascript:;" class="conta">
                  <img src="<?php __e(base_url() . 'images/icons/magnifier.png' );?>" title="Show preview" width="16" height="16" onclick="javascript:slideme('cont2','cl','fast');"/>
                </a>
                <a href="javascript:;" class="conta" onclick="javascript:slideme('ab2','cl','fast');" title="Show preview">Show preview</a>                
              </td>
            </tr>
            <tr>  
              <td align="left" valign="top">
                <div class="show_cont ab2" style="display: none;">                     
                  <p><?php __display_data( __earray($current_volume,'os_volume_abtract', TRUE));?></p>
                </div>
              </td>
            </tr>
          </table></td>
        <td>&nbsp;</td>  
      </tr>
      
      <tr>
        <td>&nbsp;</td>
        <td width="2%" align="left" valign="top">3</td>
        <td width="5%" align="left" valign="top"><input type="checkbox" class="chk" name="chk_id" /></td>
        <td width="5%" align="left" valign="top"><img src="<?php __e(base_url() . 'images/icons/folder_table.png' );?>" width="16" height="16" /></td>
        <td align="left" valign="top"><table width="100%" cellpadding="0" cellspacing="0" class="info_data">
            <tr>
              <td width="2%" align="left" valign="top"><h4>Table Of Contents</h4></td>
            </tr>
            <tr>  
              <td align="left" valign="top">
                <a href="javascript:;" class="conta">
                  <img src="<?php __e(base_url() . 'images/icons/magnifier.png' );?>" title="Show preview" width="16" height="16" onclick="javascript:slideme('cont2','cl','fast');"/>
                </a>
                <a href="javascript:;" class="conta" onclick="javascript:slideme('cont2','cl','fast');" title="Show preview">Show preview</a>                
              </td>
            </tr>
            <tr>  
              <td align="left" valign="top">
                <div class="show_cont cont2" style="display: none;">                     
                  <p><?php __display_data(__earray($current_volume,'os_volume_content', TRUE));?></p>
                </div>
              </td>
            </tr>
          </table></td>
        <td>&nbsp;</td>  
      </tr>
      
      <?php       
      extract($articles_list);      
      if($articles_num_rows > 0){
        
        foreach ($articles_data as $key => $value) {
        ?>  
        <tr>
          <td>&nbsp;</td>
          <td width="2%" align="left" valign="top">A.<?php __display_data($value['os_articles_id']);?></td>
          <td width="5%" align="left" valign="top"><input type="checkbox" class="chk" name="chk_id" /></td>
          <td width="5%" align="left" valign="top"><img src="<?php __e(base_url() . 'images/icons/report.png' );?>" width="16" height="16" /></td>
          <td align="left" valign="top">
            <div class="pan_1"><table width="100%" cellpadding="0" cellspacing="0" class="info_data">
              <tr>
                <td width="2%" align="left" valign="top"><h4><?php __display_data($value['os_articles_title']);?></h4></td>
              </tr>
              <tr>
                <td width="6%" align="left" valign="top"><i>Page: <?php __display_data($value['os_articles_pages']);?></i></td>
              </tr>
              <tr>
                <td width="6%" align="left" valign="top">Author: <i><?php __display_data($value['os_articles_author']);?></i></td>
              </tr>
              <tr>
                <td width="6%" align="left" valign="top">Access: <i><?php $chk = ($value['os_articles_acess_type']==1)?'Paid':'Open';__display_data($chk);?></i>, 
                  Price: <i><?php __display_data(__price($value['os_articles_price']));?></i></td>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <a href="javascript:;" class="conta">
                    <img src="<?php __e(base_url() . 'images/icons/magnifier.png' );?>" title="Show preview" width="16" height="16" onclick="javascript:slideme('<?php __display_data($value['os_articles_id']);?>','cl','fast');"/>
                  </a>
                  <a href="javascript:;" class="conta" onclick="javascript:slideme('<?php __display_data($value['os_articles_id']);?>','cl','fast');fn_stats_a_read('<?php __display_data($value['os_articles_id']);?>');" title="Show preview">Show preview</a>                
                  <?php 
                    $os_pop_up = site_url($c.'/bookpreview/'.$value['os_articles_id']);
                    $img = array('src' => 'images/read_article.png',
                        'alt' =>'Read Article - '.filter_data($value['os_articles_title']),
                        'title' => 'Read Article - '.filter_data($value['os_articles_title']),
                        'width' => '125','height' => '32','border' => '0', 'style' => 'margin-top:-6px;');
                    if(__is_loggedin()){
                    __e( '<a href="javascript:;" title="Read Article - '. filter_data($value['os_articles_title']) .'" onclick="fn_opn_art(\''.$os_pop_up.'\');">'. img($img) .'</a>' );
                    }else{
                      __e( '<a href="javascript:;" title="Read Article - '. filter_data($value['os_articles_title']) .'" onclick="login_err_msg();">'. img($img) .'</a>' );
                    }
                  ?>
                </td>
              </tr>
              <tr>  
                <td align="left" valign="top">
                  <div class="show_cont <?php __display_data($value['os_articles_id']);?>" style="display: none;">
                    <strong class="strg">Abstract Data</strong>
                    <p>
                      <?php __display_data($value['os_articles_abstract']);?>
                    </p>
                  </div>
                </td>
              </tr>
            </table></div>
            <div class="pan_2">
              <?php __e(__btn_sub($value));?><br/><br/><?php __e(__btn_dwl($value));?> 
            </div>
          </td>
          <td>&nbsp;</td>  
        </tr>  
          
        <?php 
        }/*</foreach ($articles_data as $key => $value) >*/
        
      }/*</if($articles_num_rows > 0)>*/ 
      ?>
    </tbody>
  </table>
  <?php }else{ ?>
  <p>Please Login to view this Journal, or </p>
  <p>Please click here to subscribe for this journal: </p>
  <p>
    <?php 
                  $img_param = array(
                  'src' => 'images/subscribe.png',
                  'title' => 'Subscribe '. filter_data($journals_data['os_journals_title'],'display'),
                  'alt' => 'Subscribe '. filter_data($journals_data['os_journals_title'],'display'),
                  'width' => 130,
                  'height' => 44,
                  'border' => 0
                  );
                  $str = img($img_param);
                  ?>
    <a href="<?php __e(site_url('members'));?>" title="Subscribe <?php __e(filter_data($journals_data['os_journals_title']));?>"><?php __e($str);?></a>
  </p>    
  
  <?php } ?>
</form>